import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * pix模块-推广平台信息
 */
@Entity('pix')
export class PixPromotionPlatformEntity extends BaseEntity {
  @Index()
  @Column({ comment: '推广平台ID' })
  promotionPlatformId: string;

  @Index()
  @Column({ comment: 'b端用户ID' })
  userId: string;

  @Column({ comment: '名称' })
  name: string;

  @Index()
  @Column({ comment: '事件代码' })
  eventCode: string;

  @Column({ comment: '访问令牌' })
  accessToken: string;

  @Column({ comment: '状态 0-无API上报 1-可API上报', default: 0 })
  status: number;

  @Column({ comment: '错误信息', nullable: true })
  errorMsg: string;

  @Column({ comment: '创建时间', type: 'datetime' })
  createTime: Date;

  @Column({ comment: '更新时间', type: 'datetime' })
  updateTime: Date;
}
